# from flask_oauthlib.provider import OAuth2Provider

# oauth = OAuth2Provider()
#
# from .libs import qiniu_uploader
# from .libs import sms_service

from extensions import  redis_store, oauth

def get_oauth_member(valid, auth):
    pass
    # print(valid, auth)
    # if valid:
    #     from flask import g
    #     from .models.member import Member
    #     from .models.admin_user import AdminUser
    #
    #     # g.user = auth.user['info']
    #     print(auth.user)
    #     type = auth.user.get('type')
    #     if type == 'member':
    #         g.user = Member.get(Member.id == auth.user['info']['id'])
    #         g.agency = g.user.supplier
    #         g.supplier = g.user.supplier
    #     else:
    #         g.user = AdminUser.get(AdminUser.id == auth.user['info']['id'])
    #         g.agency = g.user.agency
    # return valid, auth


oauth.after_request(get_oauth_member)
